package com.kingwang.training.designpattern.mediator.bo;

import lombok.Data;

/**
 * 联合国安理会
 *
 * @author King
 */
@Data
public class UnitedNationSecurityCouncil implements UnitedNations {
    private Country colleague1;
    private Country colleague2;

    @Override
    public void declare(Country colleague, String message) {
        if (colleague.getClass().equals(this.colleague1.getClass())) {
            this.colleague2.receive(message);
        } else {
            this.colleague1.receive(message);
        }
    }
}
